]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Revert "WeatherClient: Set enabled providers after setting a valid location"
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 12 Jan 2021 17:33:43 +0000 (18:33 +0100)
committerMarge Bot <marge-bot@gnome.org>
Wed, 13 Jan 2021 21:03:35 +0000 (21:03 +0000)
libgweather changed to not do any implicit network traffic in property setters,
so this is again safe to pass to the constructor.

This reverts commit 73b7d9ace463fd29a0bd7f315f1d87068c033062.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3577

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1565>

js/misc/weather.js

index e518f2285be350ad7c1018a374ed1feeca4bdbbb..97880ea91eb4436f18e4066e8be0d8a3fe0a20d2 100644 (file)
@@ -68,11 +68,10 @@ var WeatherClient = class {
 
         this._world = GWeather.Location.get_world();
 
-        this._providers = GWeather.Provider.METAR |
-                          GWeather.Provider.YR_NO |
-                          GWeather.Provider.OWM;
-
-        this._weatherInfo = new GWeather.Info({ enabled_providers: 0 });
+        let providers = GWeather.Provider.METAR |
+                        GWeather.Provider.YR_NO |
+                        GWeather.Provider.OWM;
+        this._weatherInfo = new GWeather.Info({ enabled_providers: providers });
         this._weatherInfo.connect_after('updated', () => {
             this._lastUpdate = GLib.DateTime.new_now_local();
             this.emit('changed');
@@ -216,8 +215,6 @@ var WeatherClient = class {
         this._weatherInfo.set_location(location);
         this._locationValid = location != null;
 
-        this._weatherInfo.set_enabled_providers(location ? this._providers : 0);
-
         if (location)
             this._loadInfo();
         else